Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit dc475a0e904ff7cbf24881891fd85a819c019dcb


Parents : c323fcb
Author : Ivan <ivan@quad4.io>
Signature : Signature validation error
Date : 2026-04-16T03:37:07-05:00

fix(android): ensure compatibility of virtual environment by linking python3 to python if necessary

Changes

1 files changed, 6 insertions(+), 0 deletions(-)


Diff

diff --git a/scripts/build-android-wheels-local.sh b/scripts/build-android-wheels-local.sh
index a3ff3bc6..2dddf0f8 100755
--- a/scripts/build-android-wheels-local.sh
+++ b/scripts/build-android-wheels-local.sh
@@ -178,7 +178,13 @@ popd >/dev/null
PYPIDIR="${CHAQUOPY_DIR}/server/pypi"
VENV_DIR="${PYPIDIR}/.venv-local"
+rm -rf "${VENV_DIR}"
"${PYTHON_BIN}" -m venv "${VENV_DIR}"
+# Some Python images only provide python3/python3.X in venv bin, while the
+# script below invokes `${VENV_DIR}/bin/python`.
+if [[ ! -e "${VENV_DIR}/bin/python" && -e "${VENV_DIR}/bin/python3" ]]; then
+ ln -sf python3 "${VENV_DIR}/bin/python"
+fi
"${VENV_DIR}/bin/pip" install --upgrade pip
"${VENV_DIR}/bin/pip" install -r "${PYPIDIR}/requirements.txt"
"${VENV_DIR}/bin/pip" install "numpy==${NUMPY_VERSION}"


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────